package com.frame.work.common.util;

import org.apache.commons.lang3.StringUtils;

public class Frame {

    /**
     * 字符串截取，截取把头2A和数据长度，尾部23和校验位去掉
     *
     * @param frameString
     * @return
     */
    public static String getData(String frameString) {
        String ff = StringUtils.substring(frameString, 2, 4);
        if ("FF".equals(ff)) {
            return frameString.substring(6, frameString.length() - 4);
        } else {
            return frameString.substring(4, frameString.length() - 4);
        }
    }
}
